﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;
using System.Data;

public partial class UserControl_ZKQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    private void GetContent(string Title)
    {
        KCAdvanceQuery kcquery = new KCAdvanceQuery();
        string strTitle = this.Titlename.Text;
        string strFileID = Request.Form["ZL_FILE_ID"];
        string strZKCODE = Request.Form["ZKCODE"];
        string strKTLCODE = Request.Form["KTLCODE"];
        string strtxtPKIIHStart = Request.Form["txtPKIIHStart"];
        string strtxtPKIIHEnd = Request.Form["txtPKIIHEnd"];





        //dl_FileList.DataSource = kcquery.YXAdvancedQuery(strTitle, strFileID, strZKCODE, strKTLCODE, strtxtPKIIHStart, strtxtPKIIHEnd);
        //dl_FileList.DataBind();

        DataSet ds = kcquery.YXAdvancedQuery(strTitle, strFileID, strZKCODE, strKTLCODE, strtxtPKIIHStart, strtxtPKIIHEnd);
        DataTable dt = ds.Tables[0];
        DataView dv = dt.DefaultView;
        //对用于分页的类的引用
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = dt.DefaultView;//设置数据源(DataTable类型)
        pds.AllowPaging = true;


        AspNetPager1.RecordCount = dv.Count;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        dl_FileList.DataSource = pds;
        dl_FileList.DataBind();



    }


    protected void SearchBtn_Click(object sender, ImageClickEventArgs e)
    {
        GetContent("");
        FileList.Attributes["style"] = "display:''";

    }


    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetContent("");
    }
}
